﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WyUnity.Utility
{
	public static class EventsHelper
	{
		/// <summary>
		/// 安全的引发事件
		/// </summary>
		public static void Raise<T>(this EventHandler<T> eventDelegate, object sender, T eventArg) where T : System.EventArgs
		{
			var ed = eventDelegate;
			if (ed != null)
				ed(sender, eventArg);
		}
	}
}
